package com.jxtpro.user;

import com.jfinal.core.Controller;
import com.jfinal.kit.Ret;
/**
 * 用户页面控制器
 * @author x
 *
 */
public class UserController extends Controller{

	/**
	 * 用户首页访问地址
	 */
	public void index(){
		Ret r = UserService.srv.all();
		setAttr("users", r);
		renderJsp("index.jsp");
	}
	
	public void findUser(){
		Integer id = getParaToInt("id");
		System.out.println("id : " + id);
		Ret r = UserService.srv.findById(id);
		System.out.println("result:"+r.toJson());
		setAttr("user", r.get("user"));
		renderJsp("index.jsp");
	}
}
